package 作业监听;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * create at 2018/10/17
 * author: suveng
 * email: suveng@163.com
 **/
public class MyJobListener implements org.quartz.JobListener {
    public static final String LISTENER_NAME="su-listener";
    @Override
    public String getName() {
        return LISTENER_NAME;
    }

    @Override
    public void jobToBeExecuted(JobExecutionContext jobExecutionContext) {
        System.out.println("执行定时任务之前要做的事----------");
    }

    @Override
    public void jobExecutionVetoed(JobExecutionContext jobExecutionContext) {
        System.out.println("随机执行的事件");
    }

    @Override
    public void jobWasExecuted(JobExecutionContext jobExecutionContext, JobExecutionException e) {
        System.out.println("执行定时任务之后------------");
    }
}
